package com.gxd.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gxd.common.core.domain.MpBaseEntity;
import com.gxd.common.utils.GUID;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author gxd
 * @since 2025/6/17
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "t_call_track", autoResultMap = true)
@ApiModel(description = "通话记录表 实体类")
public class CallTrack extends MpBaseEntity {

    /** id生成方式：GUID */
    public void setGUID() {
        this.id = new GUID().toString();
    }

    @ApiModelProperty("通话记录id")
    @TableId(type = IdType.INPUT)
    private String id;

    @ApiModelProperty("资源客户id")
    @NotEmpty(message = "资源客户id不能为空")
    private String customerId;

    @ApiModelProperty("通话时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "通话时间不能为空")
    private Date callTime;

    @ApiModelProperty("通话时长（秒）")
    @NotNull(message = "通话时长不能为空")
    private Integer callDuration;

    @ApiModelProperty("通话结果")
    @NotEmpty(message = "通话结果不能为空")
    private String callResult;

    @ApiModelProperty("是否成功（0否 1是）")
    @NotNull(message = "是否成功不能为空")
    private Integer isSuccess;

    @ApiModelProperty("下次跟进时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "下次跟进时间不能为空")
    private Date nextTime;

    @ApiModelProperty("是否删除（0否 1是）")
    private Integer deleted;

    @ApiModelProperty("备注")
    private String remark;
}
